﻿@model KRM.Core.tblProductSupportEmailTemplate
@{
    ViewBag.Title = Model.TemplateID > 0 ? "Edit: " + Model.TemplateName : "Add new template";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script src="~/js/plugins/tinymce/tinymce.min.js"></script><script type="text/javascript">
tinymce.init({
    selector: "textarea.tiny",
    height: 250,
 });
</script>
<div class="box">
    <div class="box-title">
        <h3><i class="icon-edit"></i>Add new template</h3>
    </div>
    <div class="box-content">
        @Html.Partial("Partial/_MessageResult")
        <form action="/ticket/EmailTemplateItem" method="POST">
            <input type="hidden" name="TemplateID" value="@Model.TemplateID"/>
            <div class="row-fluid">
                <div class="span2">Template Name</div>
                <div class="span8">
                    <input type="text" class="input-block-level" name="TemplateName" required="required" value="@Model.TemplateName"/>
                </div>
            </div>
            <div class="row-fluid">
                <div class="span2">Template Type</div>
                <div class="span8">
                    @Html.DropDownList("TemplateTypeID")
                </div>
            </div>
            <div class="row-fluid">
                <p>Detail</p>
                <textarea class="tiny" name="Detail">@Model.Detail</textarea>
            </div>
            <div class="text-center" style="margin-top: 30px">
                <button type="submit" class="btn btn-primary w100" style="margin-right: 10px">@(Model.TemplateID > 0 ? "Update" : "Add new")</button>
                <a href="/ticket/emailtemplate" class="btn w100">Back</a>
            </div>
        </form>
    </div>
</div>

